package org.csu.mypetstorems.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.csu.mypetstorems.entity.Item;

import java.util.List;

@Mapper
public interface ItemMapper extends BaseMapper<Item> {

    @Update("UPDATE item SET status = #{status} WHERE itemid = #{itemId}")
    int updateItemStatus(@Param("status") String status, @Param("itemId") String itemId);

    List<Item> getItemListWithCondition(String productId, String state);

    @Select("SELECT * FROM item WHERE itemid = #{itemId}")
    Item getItemList(@Param("itemId") String itemId);

}
